/**
 * 材料供应商详情页
 * Created by wujianjin on 2015/7/16.
 */

define(function (require, exports, module) {
    'use strict';
    module.exports = function (app) {
        app.register.controller('material-detail', ['$scope', '$routeParams', 'MHService',
            function ($scope, $routeParams, MHService) {

                var supplier = MHService.globalData(false, {key: 'detail'});
                //将选中的供应商数据传过来
                if(supplier){
                    $scope.selected = angular.copy(supplier);
                    $scope.feeds = undefined;
                    $scope.search = undefined;
//                    if (supplier.images) {
//                        $scope.images = supplier.images.split(',');
//                    }
                }
                $scope.suppliers = MHService.globalData(false, {key: 'auths'});
                /**
                 * 回退
                 */
                $scope.back = function () {
                    history.go(-1);
                };
            }]);
    };
});

